import type { UserConfig } from 'vite'
import electron from 'vite-plugin-electron/simple'
import react from '@vitejs/plugin-react'
import path from "path";

const config: UserConfig = {
  build: {
    outDir: 'dist/web'
  },
  resolve: {
    alias: { '@': path.resolve(__dirname, './') }
  },
  plugins: [
    react(),
    electron({
      main: {
        entry: 'electron/main.ts',
        vite: {
          build: {
            outDir: 'dist/web/electron'
          }
        }
      },
      preload: {
        input: 'electron/preload.ts',
        vite: {
          build: {
            outDir: 'dist/web/electron'
          }
        }
      }
    })
  ]
}

export default config
